Using Tables Objects

Table Objects are used to provide a link between standard Tables in an ODBC Database with the Cases and/or Instance Properties of a List type Object. The data mapping can be at design-time or at runtime.

You can create single Table objects to define a link to a Table within an external database that supports the 'ODBC' standard..

These tools on the Instance Properties & Cases editors for List type Objects can be used to link them to the Table Objects.

DSN (Data Source Name)

This will provide a list of current data sources on your system for selection and list the ODBC drivers that are available on your particular computer. For example - MS-Access 97 Database or Excel Files. Once you have selected an ODBC data source type, a dialog will appear for you to specify the location of the database (e.g. the path of the <filename>.mdb for a Microsoft Access database).

Store

Either the full connection string or the DSN only.

Tablename

After a database has been specified the tables within it should be available for selection here.

Delimiters

XpertRule uses SQL to converse with your data source. By default [square bracket] delimiters will be used to enclose the SQL commands. These are typically the most suitable for MS-Access and many other types of database. However, you may need to change these to use other makes of database. The two most common alternatives are "double-quotes" or spaces.

SQL

The data source can be filtered by providing an SQL SELECT statement. For example: "Month" = 'January' or [Month] = 'January' to filter only data where the field Month equals the text January. You may need to consult other more general documentation on SQL for help on the syntax of such statements.

You have a choice of a full (SELECT) SQL statement or just the WHERE clause of the in-built SELECT statement.

WHERE clause: Here the Tablename of the Table object is used together with the Property/Field mapping, defined by the "Setup Database Link" of the Object, to create the in-built SELECT statement.

Full SELECT: Here the specified SELECT statement (which must include the Table name and the required database fields) overrides the Objects' in-built SELECT. Here the "Setup Database Link" of the Object is used to identify the Instance Properties that correspond to the required database fields.

Manual Load at Runtime Option

By Default, all "Live" Tables are automatically loaded into the object when the XRA is loaded at run time (before the Main Agenda is executed).

The Manual Load at Runtime option allows the developer to decide when to instigate the loading, using a new "Load" method of the List object. This has a number of advantages over existing functionality:

· Allows Tables to be loaded selectively. Otherwise, all LIVE tables would be loaded regardless of need.

· Allows actions to be taken on the SQL table at runtime, before any loading of the data, by modifying the sql property of Table object.

· Allows LIVE tables to be re-loaded time and time again, on demand and with a different SELECT filter.

Preview Table Data

This button allows a preview of the first ten rows of the returned data.

Prepare for data mining

Click this button when the Table is to be used by a MinedTree object. See Table Object in the Data Mining section.

Multiple_Tables